import unittest
from ChessBoard import ChessBoard
class KingGuardTest(unittest.TestCase):
 
	def setUp(self):
		self.cb=ChessBoard()
		self.cb._board=[['.']*8]*8	

	def testCheckKingWhenNotThreatenedShouldAllowAllMoves(self):
		# Set the board to contain only '.' so that the isThreatened is always false and we will be allowed to move anywhere
		moves=[2,8]
		posFrom=[3,4]
		self.cb._board[3][4]='X'
		result=self.cb.checkKingGuard(posFrom,moves)
		# Moves provided are the same moves returned from the method
		self.assertEquals(result,moves)
		# Verify that the position from in the board was intact by the call	
		self.assertEquals('X',self.cb._board[3][4])
	def tearDown(self):
		pass

def main():
	unittest.main()

if __name__ == '__main__':
	main()
